home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / MFC / include / afxadv.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  4.9 KB  |  190 lines

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10.  
  11. // Note: This header file contains useful classes that are documented only
  12. //  in the MFC Technical Notes.  These classes may change from version to
  13. //  version, so be prepared to change your code accordingly if you utilize
  14. //  this header.  In the future, commonly used portions of this header
  15. //  may be moved and officially documented.
  16.  
  17. #ifndef __AFXADV_H__
  18. #define __AFXADV_H__
  19.  
  20. #ifndef __AFXWIN_H__
  21.     #include <afxwin.h>
  22. #endif
  23.  
  24. #ifdef _AFX_MINREBUILD
  25. #pragma component(minrebuild, off)
  26. #endif
  27. #ifndef _AFX_FULLTYPEINFO
  28. #pragma component(mintypeinfo, on)
  29. #endif
  30.  
  31. #ifdef _AFX_PACKING
  32. #pragma pack(push, _AFX_PACKING)
  33. #endif
  34.  
  35. /////////////////////////////////////////////////////////////////////////////
  36. // AFXADV - MFC Advanced Classes
  37.  
  38. // Classes declared in this file
  39.  
  40. //CObject
  41.     //CFile
  42.         //CMemFile
  43.             class CSharedFile;          // Shared memory file
  44.  
  45.     class CRecentFileList;              // used in CWinApp for MRU list
  46.     class CDockState;                   // state of docking toolbars
  47.  
  48. /////////////////////////////////////////////////////////////////////////////
  49.  
  50. #undef AFX_DATA
  51. #define AFX_DATA AFX_CORE_DATA
  52.  
  53. #if !defined(_WIN32_WCE)
  54. /////////////////////////////////////////////////////////////////////////////
  55. // Shared file support
  56.  
  57. class CSharedFile : public CMemFile
  58. {
  59.     DECLARE_DYNAMIC(CSharedFile)
  60.  
  61. public:
  62. // Constructors
  63.     CSharedFile(UINT nAllocFlags = GMEM_DDESHARE|GMEM_MOVEABLE,
  64.         UINT nGrowBytes = 4096);
  65.  
  66. // Attributes
  67.     HGLOBAL Detach();
  68.     void SetHandle(HGLOBAL hGlobalMemory, BOOL bAllowGrow = TRUE);
  69.  
  70. // Implementation
  71. public:
  72.     virtual ~CSharedFile();
  73. protected:
  74.     virtual BYTE* Alloc(DWORD nBytes);
  75.     virtual BYTE* Realloc(BYTE* lpMem, DWORD nBytes);
  76.     virtual void Free(BYTE* lpMem);
  77.  
  78.     UINT m_nAllocFlags;
  79.     HGLOBAL m_hGlobalMemory;
  80.     BOOL m_bAllowGrow;
  81. };
  82. #endif // _WIN32_WCE
  83.  
  84. /////////////////////////////////////////////////////////////////////////////
  85. // CRecentFileList
  86.  
  87. #if defined(_WIN32_WCE_PSPC)
  88. #define AFX_ABBREV_FILENAME_LEN 24 
  89. #else // _WIN32_WCE_PSPC
  90. #define AFX_ABBREV_FILENAME_LEN 30 
  91. #endif // _WIN32_WCE_PSPC
  92.  
  93. class CRecentFileList
  94. {
  95. // Constructors
  96. public:
  97.     CRecentFileList(UINT nStart, LPCTSTR lpszSection,
  98.         LPCTSTR lpszEntryFormat, int nSize,
  99.         int nMaxDispLen = AFX_ABBREV_FILENAME_LEN);
  100.  
  101. // Attributes
  102.     int GetSize() const;
  103.     CString& operator[](int nIndex);
  104.  
  105. // Operations
  106.     virtual void Remove(int nIndex);
  107.     virtual void Add(LPCTSTR lpszPathName);
  108.     BOOL GetDisplayName(CString& strName, int nIndex,
  109.         LPCTSTR lpszCurDir, int nCurDir, BOOL bAtLeastName = TRUE) const;
  110.     virtual void UpdateMenu(CCmdUI* pCmdUI);
  111.     virtual void ReadList();    // reads from registry or ini file
  112.     virtual void WriteList();   // writes to registry or ini file
  113.  
  114. // Implementation
  115.     virtual ~CRecentFileList();
  116.  
  117.     int m_nSize;                // contents of the MRU list
  118.     CString* m_arrNames;
  119.     CString m_strSectionName;   // for saving
  120.     CString m_strEntryFormat;
  121.     UINT m_nStart;              // for displaying
  122.     int m_nMaxDisplayLength;
  123.     CString m_strOriginal;      // original menu item contents
  124. };
  125.  
  126. AFX_INLINE int CRecentFileList::GetSize() const
  127.     { return m_nSize; }
  128. AFX_INLINE CString& CRecentFileList::operator[](int nIndex)
  129.     { ASSERT(nIndex < m_nSize); return m_arrNames[nIndex]; }
  130.  
  131. #if !defined(_WIN32_WCE_NO_DOCKBARS)
  132. /////////////////////////////////////////////////////////////////////////////
  133. // CDockState - used for docking serialization
  134.  
  135. class CDockState : public CObject
  136. {
  137.     DECLARE_SERIAL(CDockState)
  138.     CDockState();
  139.  
  140. public:
  141. // Attributes
  142.     CPtrArray m_arrBarInfo;
  143.  
  144. public:
  145. // Operations
  146.     void LoadState(LPCTSTR lpszProfileName);
  147.     void SaveState(LPCTSTR lpszProfileName);
  148.     void Clear(); //deletes all the barinfo's
  149.     DWORD GetVersion();
  150.  
  151. // Implementation
  152. protected:
  153.     BOOL m_bScaling;
  154.     CRect m_rectDevice;
  155.     CRect m_rectClip;
  156.     CSize m_sizeLogical;
  157.     DWORD m_dwVersion;
  158.  
  159. public:
  160.     ~CDockState();
  161.     virtual void Serialize(CArchive& ar);
  162.  
  163.     // scaling implementation
  164.     void ScalePoint(CPoint& pt);
  165.     void ScaleRectPos(CRect& rect);
  166.     CSize GetScreenSize();
  167.     void SetScreenSize(CSize& size);
  168. };
  169.  
  170. /////////////////////////////////////////////////////////////////////////////
  171. #endif // _WIN32_WCE_NO_DOCKBARS
  172.  
  173. #ifdef _AFX_PACKING
  174. #pragma pack(pop)
  175. #endif
  176.  
  177. #undef AFX_DATA
  178. #define AFX_DATA
  179.  
  180. #ifdef _AFX_MINREBUILD
  181. #pragma component(minrebuild, on)
  182. #endif
  183. #ifndef _AFX_FULLTYPEINFO
  184. #pragma component(mintypeinfo, off)
  185. #endif
  186.  
  187. #endif // __AFXADV_H__
  188.  
  189. /////////////////////////////////////////////////////////////////////////////
  190.